#ifndef __PROTOBUFFIK_TYPES_H_
#define __PROTOBUFFIK_TYPES_H_

#include <limits.h>


namespace protobuffik
{
#if defined( CHAR_BIT )
#	if CHAR_BIT != 8
#		error Invalid char type (numBits != 8)
#	endif
#endif

#if UCHAR_MAX == 0xff
	typedef unsigned char byte;
	typedef unsigned char uint_8;
	typedef signed char int_8;
#else
#	error No valid 8 bit integer type
#endif

#if USHRT_MAX == 0xffff
	typedef unsigned short uint_16;
	typedef signed short int_16;
#else
#	error No valid 16 bit integer type
#endif

#if UINT_MAX == 0xffffffff
	typedef unsigned int uint_32;
	typedef signed int int_32;
#elif USHRT_MAX == 0xffffffff
	typedef unsigned short uint_32;
	typedef signed short int_32;
#elif ULONG_MAX == 0xffffffff 
	typedef unsigned long uint_32;
	typedef signed long int_32;
#else
#	error No valid 32 bit integer type
#endif

#if ULLONG_MAX == 0xffffffffffffffff
	typedef unsigned long long uint_64;
	typedef signed long long int_64;
#else
#	error No valid 64 bit integer type
#endif

	typedef float float_32;
	typedef double float_64;
}

#endif